package org.example.booksystem.service;


import org.example.booksystem.dao.BookDao;
import org.example.booksystem.moudel.BookInfo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    private BookDao bookDao ;
    public BookService(BookDao bookDao){
        this.bookDao = bookDao ;
    }
    public List<BookInfo> getList(){
        List<BookInfo> list = bookDao.getMockList();
        for(BookInfo bookInfo : list){
            if (bookInfo.getBookStatus() == 1){
                bookInfo.setBookStatusCN("可借阅");
            }else{
                bookInfo.setBookStatusCN("不可借阅");
            }
        }
        return list ;
    }
}
